<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Spring Security Login Page</title>
</head>
<body>
    <!-- spring security的form 的action地址必须是 j_spring_security_check -->
    <form action="${pageContext.request.contextPath}/login" method="post">

        <!-- spring security 的username，password必须是 j_username，j_password -->
        用户名：<input type="text" name="username" id="username" value="${sessionScope['SPRING_SECURITY_LAST_USERNAME']}"> <br/>
        密码：<input type="password" name="password" /><br/>

        <!-- spring security 的remeberme，只需要设置一个checkbox，name=_spring_security_remember_me，不需要设置value，spring security会自动判断是否勾选 -->
        <input type="checkbox" name="_spring_security_remember_me" />两周之内不必登陆<br />
        <input type="submit" value="登陆" />
        <input type="reset" value="重置" />

    </form>
</body>
</html>
